package com.eb.dao;

import com.eb.pojo.BargainGoods;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;
import java.util.Map;

public interface KjDao extends JpaRepository<BargainGoods,Long> {
    @Query(value = "SELECT b.*,g.goods_name,g.goods_img,g.goods_price FROM bargain_goods b LEFT JOIN  goods g on b.good_id=g.id",nativeQuery = true)
    List<Map<String,Object>> shop();

    @Query(value = "SELECT b.*,g.goods_name,g.goods_img,g.goods_price FROM bargain_goods b LEFT JOIN  goods g on b.good_id=g.id where b.id=?1",nativeQuery = true)
    Map<String, Object> findById1(int id);
}
